# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=libpjf
pkgver=204.a6fb2f5
pkgrel=2
pkgdesc='A C library of data structures with tools (based on libasn).'
arch=('x86_64' 'aarch64')
url='https://github.com/pforemski/libpjf'
license=('GPL3')
depends=('pcre')
makedepends=('git')
optdepends=('linux-headers' 'linux-lts-headers' 'linux-hardened-headers'
            'linux-rt-headers' 'linux-rt-lts-headers' 'linux-zen-headers')
source=("git+https://github.com/pforemski/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  make
}

package() {
  cd $pkgname

  make DESTDIR="$pkgdir" install

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

